<script>
// custom components
import GoodsList from './components/GoodsList'
import GoodsSearch from './components/GoodsSearch'
import GoodsFooter from './components/GoodsFooter'

export default {
    name: 'goods-sale',
    render(h, context) {
        return (
            <div class="goods-sale">
                <i-card>
                    <goods-search>
                        <i-button
                            slot="left"
                            type="success"
                            onClick={this.toGoodsCreate}
                        >
                            添加商品
                        </i-button>
                    </goods-search>
                    <goods-list data={this.data} />
                    <goods-footer />
                </i-card>
            </div>
        )
    },
    data() {
        return {
            data: [
                {
                    productName:
                        '韩都衣舍2017韩版女装新款黑白拼接插肩棒球服春季短外套HH5597妠 朴信惠同款 黑白拼接 插肩袖 棒球服',
                    price: 18,
                    inventory: 23,
                    sales: 321,
                    releaseTime: '2016-10-03'
                }
            ]
        }
    },
    components: {
        GoodsList,
        GoodsSearch,
        GoodsFooter
    },
    methods: {
        toGoodsCreate() {
            this.$router.push({
                path: '/goods/create'
            })
        }
    }
}
</script>
<style lang="less" scoped>
@import '~@/assets/style/theme/index';
</style>